package com.lp.biz.system.controller;

import com.lp.biz.system.service.SysService;
import com.lp.common.annotation.PermissionAnnotation;
import com.lp.common.utils.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: backend
 * @description:
 * @author: Ke.Song
 * @since: 2024-07-06 0:24:13
 */
@RestController
@RequestMapping("/home")
public class HomeController {

    @Autowired
    private SysService sysService;

    /**
     * 获取首页
     * @return 查询结果
     */
    @GetMapping("")
    @PermissionAnnotation
    public CommonResult getHome() {
        return sysService.getHome();
    }

    /**
     * 获取首页图标
     * @param intervalType 间隔类型
     * @return 查询结果
     */
    @GetMapping("/chart")
    @PermissionAnnotation
    public CommonResult getHomeChart(@RequestParam("intervalType") Integer intervalType) {
        return sysService.getHomeChart(intervalType);
    }

}
